<?php

$difang=array("北京","上海","杭州");
echo $difang[2];
$difang[1]="天津"; 

echo "<pre>";
print_r($difang);
echo count($difang);

echo"<hr/>";
echo "foreach ;;;;.<br/>";
foreach ($difang as $value) {
    echo $value."<br/>";
    
}
echo"<hr/>";
echo "for.<br/>";
$len =  count($difang);
  for ($i = 0; $i < count($len); $i++) {
    echo $difang[$i]."<br/>","<br/>";
   }
   
   
   $message= array(
        'pic'=>"images/4.jpg",
        'name'=>'xiaohai',
       'content'=>'天天好心情111111  <span> (来自火星"女侠"的留言)</span>',
       'sex' => 'male'
   );
   foreach ($message as $key => $value){
       echo $key . "=>" . $value."<br/>";
   }
?>